package element.synt;

import ast.AstItem;
import ast.DataSignature;
import element.base.Synt;

import java.util.ArrayList;
import java.util.List;

public class ArrayLengths extends Synt {

    @Override
    public List<AstItem> toAsts() {
        ArrayList<AstItem> items = new ArrayList<>();

        int dimCount = (getNodes().size() - 1) / 2;

        for (int i = 0; i < dimCount; i++) {
            Exp exp = (Exp) getNodes().get(2 * i + 1);
            items.add(exp.toAst());
        }

        return items;
    }
}
